package sg.edu.nus.iss.vmcs.maintenance;

/*
 * Copyright 2011 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.awt.event.*;

/**
 * This class represents the control objects that monitors the Exit Button and
 * performs actions in response to the button being processed. This class implements
 * the interface ActionListener from Java AWT Event package.
 * @version 1.0  08/12/2011
 * @author Team 7S - SE19
 */

public class ExitButtonListener implements ActionListener {
	private MaintenanceController mctrl;

/**
 * This constructor creates an instance of the Exit Button Listener.
 * It receives the reference for the MaintenanceController object.
 * 
 * @param mc Maintenance Controller
 * @see MaintenanceController
 */	
	public ExitButtonListener(MaintenanceController mc) {
		mctrl = mc;
	}

/**
 * Invoked when an action occurs. Implemented as a part of interface 
 * @param e ActionEvent 
 * @see MaintenanceController#logoutMaintainer()
 */	
	public void actionPerformed(ActionEvent e) {
		mctrl.logoutMaintainer();
	}
}